package com.sy.simpleegg.mvp.contract

import com.sy.simpleegg.base.IModel
import com.sy.simpleegg.base.IPresenter
import com.sy.simpleegg.base.IView
import com.sy.simpleegg.bean.CheckMoneyBean
import com.sy.simpleegg.bean.OrderVerifyResult
import com.sy.simpleegg.bean.RepCashDataBean
import com.sy.simpleegg.bean.RepCoinDataBean
import com.sy.simpleegg.bean.SaveMoneyBean
import com.sy.simpleegg.bean.SupplementOrderBean
import com.sy.simpleegg.constant.ControlBoard
import com.sy.simpleegg.platform.BackstagePlatform

interface MainContract {
    interface View: IView{
        fun checkMoneyResult(result: CheckMoneyBean)

        fun saveMoneyResult(result: SaveMoneyBean?)

        fun postCashData(repData: Any)

        fun reportSaveCoinData(repCoinDataBean: RepCoinDataBean)

        fun saveWithdrawalCoinOrderResult(orderData: Any?)

        fun saveWriteOffOrderResult(orderData: Any)

        fun loadSupplementData(datas: MutableList<SupplementOrderBean>)

        fun verifyOrder(orderVerifyResult: OrderVerifyResult?)

        fun createOneCoinOrder(repCashDataBean: RepCashDataBean?)

        fun restartScan()

        fun out()
    }

    interface Presenter: IPresenter<View>{

        fun init()

        fun loopSaveCoin()

        fun initMqtt()

        fun initDeviceSerialport()

        fun outChannel(channelNumber: Int)

        fun testChannel(channelNumber: Int)

        fun clearCoins(k: String, coins: Long)

        fun checkReceiveMoney(tempMoney: Long, checkMoney: Long)

        fun saveMoney(checkMoney: Long, totalMoney: Long)

        fun clearMarkMoney()

        fun initCashPackageData(platform: BackstagePlatform)

        fun controlBoardConnectChange(controlBoard: ControlBoard, isConnect: Boolean)

        fun saveCashData(cash: Long, coins: Long)

        fun creatClearOrder(orderNumber: String)

        fun SaveCoinPostResult(result: Boolean)

        fun consumeCoinPostResult(result: Boolean)

        fun saveWithdrawalCoinOrder(platform: BackstagePlatform, orderData: Any)

        fun saveWriteOffOrder(platform: BackstagePlatform, orderData: Any)

        fun insertHttpOrder(platform: BackstagePlatform, transId: String, orderId: String, orderNumber: String, goodId: String, coins: String, money: String)

        fun getOrderSupplement(startDate: String, endDate: String)

        fun setRealAmount(id: Long, realAmount: String)

        fun verifyOrder(platform: BackstagePlatform, orderData: Any)

        fun createOneCoinOrder(coins: Long)

        fun uploadLog(logType: Int, logNumber: String)

        fun receiveScanOrder(scanData: String)

        fun recOutResult(success: Boolean)

        fun paibi()
    }

    interface Model: IModel{
        fun initMqtt()

        fun initDeviceSerialport()

        fun outChannel(channelNumber: Int)

        fun testChannel(channelNumber: Int)

        suspend fun clearCoins(k: String, coins: Long)

        suspend fun checkReceiveMoney(tempMoney: Long, checkMoney: Long): CheckMoneyBean

        suspend fun saveMoney(checkMoney: Long, totalMoney: Long): SaveMoneyBean?

        fun clearMarkMoney()

        suspend fun initCashPackageData(platform: BackstagePlatform)

        suspend fun controlBoardConnectChange(controlBoard: ControlBoard, isConnect: Boolean)

        suspend fun saveCashData(cash: Long, coins: Long): RepCashDataBean?

        suspend fun createClearOrder(orderNumber: String)

        suspend fun getSaveCoinFinish(): MutableList<RepCoinDataBean>?

        suspend fun setSaveCoinComplete(orderNumber: String, step: Int)

        suspend fun saveWithdrawalCoinOrder(platform: BackstagePlatform, orderData: Any): Any?

        suspend fun saveWriteOffOrder(platform: BackstagePlatform, orderData: Any): Any
        suspend fun insertHttpOrder(platform: BackstagePlatform, transId: String, orderId: String, orderNumber: String, goodId: String, coins: String, money: String)

        suspend fun getOrderSupplement(startDate: String, endDate: String): MutableList<SupplementOrderBean>

        suspend fun setRealAmount(id: Long, realAmount: String)

        suspend fun verifyOrder(platform: BackstagePlatform, orderData: Any): OrderVerifyResult?

        suspend fun createOneCoinOrder(coins: Long): RepCashDataBean?

        suspend fun uploadLog(logType: Int, logNumber: String)

        suspend fun verifyQrCode(code: String): Boolean
    }
}